from multiprocessing import Process
import time


class MyProcess(Process):
    # 需要重写run方法
    def run(self):
        while True:
            print("====myprocess====")
            time.sleep(1)


p = MyProcess()
p.start()  # 调用start方法

while True:
    print("====main====")
    time.sleep(1)
